home *** CD-ROM | disk | FTP | other *** search
- /* RexxCompAll.rexx: */
- /* rexx program to frontend to the REXX PLUS Compiler. */
- /* it takes parameters from the command line, builds a file */
- /* list, compiles and links each program in the list. */
- /* */
- /* rx RexxCompAll filname [compiler-options] [\parameters] */
-
- /* filename: */
- /* directory/path/name */
- /* * as the name causes all programs in */
- /* the directory to be compiled. */
-
- /* compiler-options: */
- /* any valid rexxplus compiler option */
-
- /* parameters: */
- /* > causes the errormessage to be saved. */
- /* NOEXIST causes only programs that are not in */
- /* RPDIR: directory to be compiled. */
- /* DELOBJ causes the object file to be deleted */
- /* afeter the link. */
- /* NOLINK causes the linker to bypassed. */
- /* NOCOMP causes the compiler to be bypassed. */
-
- signal on break_c
- signal on syntax
- signal on error
- signal on failure
- signal on ioerr
-
- address command
- parse upper arg optn'\'dboptn
-
- tstobj = ''
-
- errors = work'err'pragma('i')
- if ~open('errors',errors,'w') then exit 10
- call close('errors')
-
- if ~show('L',"rexxsupport.library") then
- call addlib "rexxsupport.library",0,-30
-
- if ~show('L',"rexxmathlib.library") then
- call addlib "rexxmathlib.library",0,-30
-
- if pos('>',dboptn) ~= 0
- then redirect = '>ram:test'
- else redirect = ''
-
- if pos('NOEXIST',dboptn) ~= 0
- then exist = 1
- else exist = 0
-
- link = 1
- if pos('NOLINK',dboptn) ~= 0 then link = 0
-
- comp = 1
- if pos('NOCOMP',dboptn) ~= 0
- then comp = 0
-
- delobj = 0
- if pos('DELOBJ',dboptn) ~= 0
- then delobj = 1
-
- work = 'ram:'
-
- 'cd ram:'
- 'set "RXCOPTS=+ECH +L +BR "'
- parse value optn with name optn
- parse value name with path':'name .
- if name = ''
- then do
- name = path
- path = ''
- end
-
- if path ~= '' then path = path':'
- cnt = lastpos('/',name)
- if cnt ~= 0
- then do
- path = path||substr(name,1,cnt)
- name = substr(name,cnt+1)
- end
-
- work = name
- do while work ~= ''
- parse value work with name'/'work
- if name ~= '' & work ~= ''
- then
- path = path||name'/'
- end
-
- if name = '*'
- then
- list = getlist()
- else
- list = name
-
- workpath = path
-
- if open('errors',errors,'a')
- then do
- call writeln('errors',list);
- call close('errors')
- end
-
- parse value list with name list
- do while name ~= ''
-
- path = workpath
- cnt = lastpos('/',name)
- if cnt ~= 0
- then do
- path = path||substr(name,1,cnt)
- name = substr(name,cnt+1)
- end
-
- say substr(words(list),1,5)||name
-
- if exist & comp
- then comp = ~exists(path||name)
- else comp = 1
-
- if comp
- then do
- doval = dorexx()
-
- doval = exists('ram:'name'.obj')
- if doval & link
- then
- 'BLink ram:'name'.obj to RPDir:'name' lib lib:brexx.lib smallcode'
-
- if delobj
- then
- 'delete ram:'name'.obj'
- end
-
- parse value list with name list
- end
- 'cd ram:'
-
- HALT:
- BREAK_C:
- exit
-
- dorexx:
- options results
- SIGNAL ON BREAK_C
- SIGNAL ON SYNTAX
- SIGNAL ON ERROR
- SIGNAL ON FAILURE
- SIGNAL ON IOERR
- if comp ~= 1 then return(0)
- temp = 'cd:t'pragma('i')
- 'cd:rexxplus +fi'path||name '+fe'temp '+foram:'name'.obj +flram:'name'.lst' optn
-
- if open('errors',errors,'a')
- then do
- call writeln('errors',name rc)
- call close('errors')
- end
- if exists(temp)
- then do
- 'type' temp
- 'join 'errors temp 'as cd:t2'pragma('i')
- 'delete 'errors
- 'delete' temp
- 'rename cd:t2'pragma('i') errors
- end
- return(rc)
-
- SYNTAX:
- IOERR:
- ERROR:
- FAILURE:
- if open('errors',errors,'a')
- then do
- call writeln('errors',' 10')
- call close('errors')
- end
- if exists(temp)
- then do
- 'type' temp
- 'join 'temp errors'as cd:t2'pragma('i')
- 'delete 'errors
- 'delete' temp
- 'rename cd:t2'pragma('i') errors
- end
- return(10)
-
- getlist: procedure expose path
- parse arg extra
-
- list = ''
- dir = showdir(path||extra,'D')
- do while dir ~= ''
- parse var dir curr dir
- list = list getlist(extra||curr'/')
- end
-
- list2 = showdir(path||extra,'F')
- do while list2 ~= ''
- parse var list2 file list2
- list = list extra||file
- end
- return list
-